package com.neulogistics.core.substation.api.application.converter;

import cn.hutool.json.JSONUtil;
import com.neulogistics.core.substation.api.application.query.TaskOrderQuery;
import com.neulogistics.core.substation.infrastructure.persistence.orm.po.TaskOrderPO;
import org.springframework.beans.BeanUtils;

public class TaskOrderQueryPOConverter {
    public static TaskOrderPO queryToPO(TaskOrderQuery taskOrderQuery){
        if(taskOrderQuery == null){
            return null;
        }

        TaskOrderPO taskOrderPO = new TaskOrderPO();

        BeanUtils.copyProperties(taskOrderQuery, taskOrderPO);

        taskOrderPO.setTaskStatus(null);

        if(taskOrderQuery.taskType == -1){
            taskOrderPO.setTaskType(null);
        }

        return taskOrderPO;
    }
}
